import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/syCategoryRule',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/syCategoryRule/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/syCategoryRule',
    method: 'put',
    data
  })
}
// 获取分类列表
export function getCateList() {
  return request({
    url: 'api/syCategoryRule/getCateList',
    method: 'get'
  })
}
// 获取类别详情
export function getCateDetail(id) {
  return request({
    url: 'api/syCategoryRule/getRlueDetail/' + id,
    method: 'get'
  })
}

export function updateConfigRate(id, data) {
  return request({
    url: 'api/syCategoryRule/updateRate/' + id,
    method: 'post',
    data
  })
}

// 刷新估价分类的价格
export function getPriceLoading(pid) {
  return request({
    url: 'api/syCategoryRule/getPriceLoading/' + pid,
    method: 'get'
  })
}

export default { add, edit, del, getCateList, getCateDetail, updateConfigRate, getPriceLoading }
